n = int(input())
numbers = []
for i in range(n):
    numbers.append(int(input()))
m = max(numbers)
print(m)
for i in range(n):
    if numbers[i]==m:
        print(i+1)